package com.example.lotapp.lotface;

import org.json.JSONObject;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;

import com.example.lotapp.R;
import com.example.lotapp.tasks.AsynServerBaseTask;

public class FootballLotResultActivity extends Activity {
	
	private EditText mInputText;
	private Button  mQueryBtn;
	private ListView mResultListView;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_football_lotresult);
		
		mInputText = (EditText) findViewById(R.id.input_date);
		mQueryBtn = (Button) findViewById(R.id.query);
		mResultListView = (ListView) findViewById(R.id.result_list);
		
		mQueryBtn.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				JSONObject jsonObject = new JSONObject();
				try {
					jsonObject.put("IssueID", "284392");
					jsonObject.put("PageNo", 1);
					jsonObject.put("PageSize", 100);
				} catch (Exception e) {
				}
				
				new AsynServerBaseTask("310") {
					@Override
					protected void onPostExecute(String result) {
						mInputText.setText(result);
				    }
				}.execute(jsonObject.toString());
			}
		});
	}
}
